// 车辆管理 - 档案完善
import { pget, ppostJson, postFileByFormData } from '@/utils/req';
import { modalApi } from '@/utils/modalReq';

// 档案完善列表
export function getTableList(query: any) {
  return pget(`${modalApi.carMessage}/carhouse/page`, query);
}

// 根据城市及公司查询备车流程
export function getNodeList(query: any) {
  return pget(
    `${modalApi.carMessage}/assetsstandbyprocess/getProcessNode`,
    query,
  );
}

// 接收合格证
export function postReceiveCert(data: any) {
  return ppostJson(`${modalApi.carMessage}/carhouse/receiveCert`, data);
}

// 接收发票
export function postReceiveInv(data: any) {
  return ppostJson(`${modalApi.carMessage}/carhouse/receiveInv`, data);
}

// 缴纳购置税
export function postReceivePurchaseTax(data: any) {
  return ppostJson(`${modalApi.carMessage}/carhouse/receivePurchaseTax`, data);
}

// 上牌
export function postPlateReg(carId: number) {
  return ppostJson(`${modalApi.carMessage}/carhouse/plateReg?carId=${carId}`);
}

// 批量备车
export function postBatchPrepareCar(data: any) {
  return ppostJson(`${modalApi.carMessage}/carhouse/batchPrepareCar`, data);
}
// 批量上传证照
export function uploadImg(carPrepareId: any, data: any) {
  return ppostJson(
    `${modalApi.carMessage}/assetscarcertificate/uploadCertificate?carPrepareId=${carPrepareId}`,
    data,
  );
}
// 保险导入检查
export const importInsuranceCheck = `${modalApi.carMessage}/assertsCarInsurancebase/importInsurance`;

// 保险导入
export function importInsurance(data: any) {
  return postFileByFormData(
    `${modalApi.carMessage}/assertsCarInsurancebase/importInsurance`,
    data,
  );
}

// 保险导入数据异常信息
export function getInsuranceErrorList(query: any) {
  return pget(
    `${modalApi.carMessage}/assetsaccidentdataprocessing/prepareInsurancePage`,
    query,
  );
}

// 设备导入检查
export const importEquipmentCheck = `${modalApi.carMessage}/carhouse/import/checkCarInstall`;

// 设备导入
export function importEquipment(data: any) {
  return postFileByFormData(
    `${modalApi.carMessage}/carhouse/importCarInstall`,
    data,
  );
}

// 设备导入数据异常信息
export function getEquipmentErrorList(query: any) {
  return pget(
    `${modalApi.carMessage}/assetsaccidentdataprocessing/installPage`,
    query,
  );
}
